package cn.jlearn.proxy.web.controller;

import cn.jlearn.proxy.web.service.HomeService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;

/**
 * @author qianyingchao
 * @version 1.0
 * @date 2021/7/15 10:25 上午
 */
@Controller
@RequestMapping(value = "/admin")
public class HomeController {

    @Resource
    private HomeService homeService;

    @GetMapping(value = "/home.html")
    public ModelAndView home() {
        ModelAndView mv = new ModelAndView("home/index");
        mv.addObject("record", homeService.getLatestAgent());
        return mv;
    }

}
